<template>
    <div>
        <!-- 手机端 -->
        <div class="head u-flex">
            <img src="@/image/index/back.png" v-if="topIndex == 'det'" @click="back" class="back">
            <img src="@/image/russia/logo2.png" class="logo">
        </div>
        <div class="zhan"></div>
    </div>
</template>

<script>
import {
    useStore
} from 'vuex';
import { ref, watch, computed, getCurrentInstance } from "vue";
export default {
    props: {
    // 显示文字
    topIndex: {
      type: String,
      default: '',
    },
  },
    data() {
        return {
            imgUrl: '',
            store: '',
            innerWidth: 0
        };
    },
    created() {
        const { appContext } = getCurrentInstance();
        this.imgUrl = appContext.config.globalProperties.$imgUrl;
        this.store = useStore();
        this.scrollToTop()
        this.innerWidth = window.innerWidth
    },
    methods: {
        scrollToTop() {
            window.scrollTo({
                top: 0,
            });
        },
        back(){
            this.$router.go(-1);
        }
    }
};
</script>

<style scoped lang="less">
// 手机端
.head {
    top: 0;
    width: 100%;
    height: 50px;
    left: 0;
    position: fixed;
    padding: 0 15px;
    // z-index: 2011;
    background: #FFF;
    box-shadow: 0px 1px 1px 1px rgba(0, 0, 0, 0.16);

    .back {
        width: 15px;
        height: auto;
        margin-right: 10px;
    }
    .logo {
        width: 37px;
        height: auto;
    }
}
.zhan{
    height: 50px;
}
</style>